//根据环境，编译不同的请求地址
import appConfig from "../appConfig.json"
let baseURL = "";
let imgURL = "";
//环境检测
let type =
	import.meta.env.MODE
switch (type) {
	//打包上线
	case 'production':
		baseURL = appConfig.urls.production;
		imgURL = appConfig.imageUrl.production;
		break
		//测试线上
	case 'test':
		//#ifdef APP-PLUS ||MP-WEIXIN
		baseURL = appConfig.urls[type];
		//#endif
		//#ifdef H5
		baseURL = '/testApi';
		//#endif 
		imgURL = appConfig.imageUrl[type];
		break
		//开发默认
	default:
		//#ifdef APP-PLUS ||MP-WEIXIN
		baseURL = appConfig.urls[type];
		//#endif
		//#ifdef H5
		baseURL = '/api';
		//#endif 
		imgURL = appConfig.imageUrl[type];
		break
}

export default {
	baseURL,
	imgURL
};
